package com.zhika.zishi.adapter;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.BaseAdapter;
import android.widget.TextView;

import com.zhika.zishi.R;

import java.util.ArrayList;

/**
 * Created by shi-02 on 2015/4/19.
 */
public class ItemInformAdapter extends ArrayAdapter<String> {

    private Context context;

    private ArrayList<String> list;

    private int resourceId;

    public ItemInformAdapter(Context context,int resourceId,ArrayList<String> list){
        super(context,resourceId,list);

        this.context = context;

        this.list = list;

        this.resourceId = resourceId;
    }

    @Override
    public View getView(int position, View convertView, ViewGroup parent) {

        View view = LayoutInflater.from(context).inflate(resourceId,null);
        TextView contentText = (TextView) view.findViewById(R.id.item_of_inform_content_text);
        String content = list.get(position);
        contentText.setText(content);

        return view;
    }
}
